#!/usr/bin/env python
# -*- coding: utf-8 -*-
#code:utf-8
#
# Copyright(C) 2011 SupDo.com
# Licensed under the GUN License, Version 3.0 (the "License");
# 
# File:        sysModel.py
# Author:    KuKei
# Create Date: 2011-10-22
# Description: 系统部分模型
# Modify Date: 2011-10-22


from django.db import models
from sd.cms.models import BaseModel

SEX_CHOICES = (
    ('1', '男.'),
    ('2', '女.'),
    ('0', '不告诉你.'),
)

class User(BaseModel):
    username = models.CharField("用户名", max_length=30, unique=True)
    password = models.CharField("密码", max_length=40)
    nickname = models.CharField("昵称", max_length=40)
    sex = models.CharField("性别", max_length=1, choices=SEX_CHOICES)
    froms = models.CharField("来自", max_length=100, blank=True)
    mobile = models.CharField("手机", max_length=11, blank=True)
    email = models.EmailField("邮箱", blank=True)
    qq = models.CharField("QQ", max_length=15, blank=True)
    birthday = models.DateField("生日", blank=True, null=True, help_text="输入格式: YYYY-MM-DD")
    homepage = models.URLField("主页", blank=True)
    alipay = models.CharField("支付宝", max_length=30, blank=True)
    introduction = models.TextField("简介", blank=True)
    power = models.IntegerField()
    crtip = models.IPAddressField()
    crtdate = models.DateTimeField()
    remark = models.TextField("备注", )
    preserve01 = models.IntegerField(null=True)
    preserve02 = models.CharField(max_length=20, null=True)
    preserve03 = models.TextField(null=True)
    
    
    class Meta(BaseModel.Meta):
        ordering = ["id"]
    
    def __unicode__(self):
        return self.username
    